<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;
use app\traits\MyModelTrait;

/**
 * @mixin \think\Model
 */
class AdminActionLog extends Model
{
    use MyModelTrait;

    // 后台操作日志
    protected $table = 'admin_action_log';

    /**
     * 生成记录
     *
     * @param int    $admin_user_id
     * @param string $uri
     * @param string $ip
     * @param string $remark
     */
    public static function generateLog(int $admin_user_id, string $uri, string $ip, string $remark): void
    {
        $insert = [
            'admin_user_id' => $admin_user_id,
            'uri'           => $uri,
            'ip'            => $ip,
            'remark'        => $remark,
            'created_at'    => date('Y-m-d H:i:s')
        ];
        self::insert($insert);
    }// generateLog() end
}
